package com.ckerchina.admin.ckadmin.service.wx.messagehandler;

import org.springframework.stereotype.Service;

import com.ckerchina.admin.ckadmin.service.wx.WxMessage;
import com.ckerchina.admin.ckadmin.service.wx.WxMessageHandler;

import java.util.Date;

/**
 * Created by 晓丰 on 2016/1/11.
 */
@Service
public class TextMessageHandler implements WxMessageHandler{
    @Override
    public WxMessage handleMessage(WxMessage wxMessage) {
        return getTextResponseMessage(wxMessage);
    }
    private WxMessage getTextResponseMessage(WxMessage wxMessage) {
        WxMessage returnMessage=new WxMessage();
        returnMessage.setCreateTime(new Date());
        returnMessage.setContent("2");
        returnMessage.setMsgType("text");
         
        returnMessage.setFromUserName(wxMessage.getToUserName());
        returnMessage.setToUserName(wxMessage.getFromUserName());
        return returnMessage;
    }
}
